<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>s3.generator</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="s3-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

      <th class="navbar" width="100%"></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        <a href="s3-module.html">Package&nbsp;s3</a> ::
        Module&nbsp;generator
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
    onclick="toggle_private();">hide private</a>]</span></td></tr>
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="s3.generator-pysrc.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<h1 class="epydoc">Source Code for <a href="s3.generator-module.html">Module s3.generator</a></h1>
<pre class="py-src">
<tt class="py-lineno">  1</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt id="link-0" class="py-name" targets="Package s3=s3-module.html"><a title="s3" class="py-name" href="#" onclick="return doclink('link-0', 's3', 'link-0');">s3</a></tt></tt> </tt>
<tt class="py-lineno">  2</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">re</tt> </tt>
<tt class="py-lineno">  3</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">sha</tt> </tt>
<tt class="py-lineno">  4</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">hmac</tt> </tt>
<tt class="py-lineno">  5</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">time</tt> </tt>
<tt class="py-lineno">  6</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">base64</tt> </tt>
<tt class="py-lineno">  7</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">urllib</tt> </tt>
<tt class="py-lineno">  8</tt>  <tt class="py-line"> </tt>
<tt class="py-lineno">  9</tt>  <tt class="py-line"><tt id="link-1" class="py-name" targets="Variable s3.connection.PORTS_BY_SECURITY=s3.connection-module.html#PORTS_BY_SECURITY,Variable s3.generator.PORTS_BY_SECURITY=s3.generator-module.html#PORTS_BY_SECURITY"><a title="s3.connection.PORTS_BY_SECURITY
s3.generator.PORTS_BY_SECURITY" class="py-name" href="#" onclick="return doclink('link-1', 'PORTS_BY_SECURITY', 'link-1');">PORTS_BY_SECURITY</a></tt></tt> <tt class="py-op">=</tt> <tt class="py-op">{</tt> <tt class="py-name">True</tt><tt class="py-op">:</tt> <tt class="py-number">443</tt><tt class="py-op">,</tt> <tt class="py-name">False</tt><tt class="py-op">:</tt> <tt class="py-number">80</tt> <tt class="py-op">}</tt> </tt>
<tt class="py-lineno"> 10</tt>  <tt class="py-line"> </tt>
<tt class="py-lineno"> 11</tt>  <tt class="py-line"><tt id="link-2" class="py-name" targets="Variable s3.generator.DEFAULT_EXPIRES_IN=s3.generator-module.html#DEFAULT_EXPIRES_IN"><a title="s3.generator.DEFAULT_EXPIRES_IN" class="py-name" href="#" onclick="return doclink('link-2', 'DEFAULT_EXPIRES_IN', 'link-2');">DEFAULT_EXPIRES_IN</a></tt></tt> <tt class="py-op">=</tt> <tt class="py-number">60</tt> </tt>
<tt class="py-lineno"> 12</tt>  <tt class="py-line"> </tt>
<a name="S3Generator"></a><div id="S3Generator-def"><tt class="py-lineno"> 13</tt> <a class="py-toggle" href="#" id="S3Generator-toggle" onclick="return toggle('S3Generator');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="s3.generator.S3Generator-class.html">S3Generator</a><tt class="py-op">(</tt><tt class="py-base-class">object</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="S3Generator-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="S3Generator-expanded"><tt class="py-lineno"> 14</tt>  <tt class="py-line">    <tt class="py-docstring">"""</tt> </tt>
<tt class="py-lineno"> 15</tt>  <tt class="py-line"><tt class="py-docstring">    Generator class</tt> </tt>
<tt class="py-lineno"> 16</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<tt class="py-lineno"> 17</tt>  <tt class="py-line"><tt class="py-docstring">    Objects of this class are used for generating authenticated URLs for accessing</tt> </tt>
<tt class="py-lineno"> 18</tt>  <tt class="py-line"><tt class="py-docstring">    Amazon's S3 service.</tt> </tt>
<tt class="py-lineno"> 19</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
<tt class="py-lineno"> 20</tt>  <tt class="py-line">     </tt>
<a name="S3Generator.__init__"></a><div id="S3Generator.__init__-def"><tt class="py-lineno"> 21</tt> <a class="py-toggle" href="#" id="S3Generator.__init__-toggle" onclick="return toggle('S3Generator.__init__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="s3.generator.S3Generator-class.html#__init__">__init__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">pub_key</tt><tt class="py-op">,</tt> <tt class="py-param">priv_key</tt><tt class="py-op">,</tt> <tt class="py-param">secure</tt><tt class="py-op">=</tt><tt class="py-name">True</tt><tt class="py-op">,</tt> <tt class="py-param">host</tt><tt class="py-op">=</tt><tt id="link-3" class="py-name"><a title="s3" class="py-name" href="#" onclick="return doclink('link-3', 's3', 'link-0');">s3</a></tt></tt><tt class="py-op">.</tt><tt id="link-4" class="py-name" targets="Variable s3.DEFAULT_HOST=s3-module.html#DEFAULT_HOST"><a title="s3.DEFAULT_HOST" class="py-name" href="#" onclick="return doclink('link-4', 'DEFAULT_HOST', 'link-4');">DEFAULT_HOST</a></tt></tt><tt class="py-op">,</tt> <tt class="py-param">port</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="S3Generator.__init__-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="S3Generator.__init__-expanded"><tt class="py-lineno"> 22</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_pub_key</tt> <tt class="py-op">=</tt> <tt class="py-name">pub_key</tt> </tt>
<tt class="py-lineno"> 23</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_priv_key</tt> <tt class="py-op">=</tt> <tt class="py-name">priv_key</tt> </tt>
<tt class="py-lineno"> 24</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_host</tt> <tt class="py-op">=</tt> <tt class="py-name">host</tt> </tt>
<tt class="py-lineno"> 25</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">port</tt><tt class="py-op">:</tt> </tt>
<tt class="py-lineno"> 26</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_port</tt> <tt class="py-op">=</tt> <tt id="link-5" class="py-name"><a title="s3.connection.PORTS_BY_SECURITY
s3.generator.PORTS_BY_SECURITY" class="py-name" href="#" onclick="return doclink('link-5', 'PORTS_BY_SECURITY', 'link-1');">PORTS_BY_SECURITY</a></tt></tt><tt class="py-op">[</tt><tt class="py-name">secure</tt><tt class="py-op">]</tt> </tt>
<tt class="py-lineno"> 27</tt>  <tt class="py-line">        <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<tt class="py-lineno"> 28</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_port</tt> <tt class="py-op">=</tt> <tt class="py-name">port</tt> </tt>
<tt class="py-lineno"> 29</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-op">(</tt><tt class="py-name">secure</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<tt class="py-lineno"> 30</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">protocol</tt> <tt class="py-op">=</tt> <tt class="py-string">'https'</tt> </tt>
<tt class="py-lineno"> 31</tt>  <tt class="py-line">        <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<tt class="py-lineno"> 32</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">protocol</tt> <tt class="py-op">=</tt> <tt class="py-string">'http'</tt> </tt>
<tt class="py-lineno"> 33</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_secure</tt> <tt class="py-op">=</tt> <tt class="py-name">secure</tt> </tt>
<tt class="py-lineno"> 34</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">server_name</tt> <tt class="py-op">=</tt> <tt class="py-string">"%s:%d"</tt> <tt class="py-op">%</tt> <tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_host</tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_port</tt><tt class="py-op">)</tt> </tt>
<tt class="py-lineno"> 35</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_expires_in</tt> <tt class="py-op">=</tt> <tt id="link-6" class="py-name"><a title="s3.generator.DEFAULT_EXPIRES_IN" class="py-name" href="#" onclick="return doclink('link-6', 'DEFAULT_EXPIRES_IN', 'link-2');">DEFAULT_EXPIRES_IN</a></tt></tt> </tt>
<tt class="py-lineno"> 36</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_expires</tt> <tt class="py-op">=</tt> <tt class="py-name">None</tt> </tt>
</div><tt class="py-lineno"> 37</tt>  <tt class="py-line"> </tt>
<a name="S3Generator.set_expires_in"></a><div id="S3Generator.set_expires_in-def"><tt class="py-lineno"> 38</tt> <a class="py-toggle" href="#" id="S3Generator.set_expires_in-toggle" onclick="return toggle('S3Generator.set_expires_in');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="s3.generator.S3Generator-class.html#set_expires_in">set_expires_in</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">expires_in</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="S3Generator.set_expires_in-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="S3Generator.set_expires_in-expanded"><tt class="py-lineno"> 39</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<tt class="py-lineno"> 40</tt>  <tt class="py-line"><tt class="py-docstring">        Set relative expiration time from the url creation moment.</tt> </tt>
<tt class="py-lineno"> 41</tt>  <tt class="py-line"><tt class="py-docstring">        </tt> </tt>
<tt class="py-lineno"> 42</tt>  <tt class="py-line"><tt class="py-docstring">        @param expires_in: Relative expiration time</tt> </tt>
<tt class="py-lineno"> 43</tt>  <tt class="py-line"><tt class="py-docstring">        @type  expires_in: int</tt> </tt>
<tt class="py-lineno"> 44</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<tt class="py-lineno"> 45</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_expires_in</tt> <tt class="py-op">=</tt> <tt class="py-name">expires_in</tt> </tt>
<tt class="py-lineno"> 46</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_expires</tt> <tt class="py-op">=</tt> <tt class="py-name">None</tt> </tt>
</div><tt class="py-lineno"> 47</tt>  <tt class="py-line"> </tt>
<a name="S3Generator.set_expires"></a><div id="S3Generator.set_expires-def"><tt class="py-lineno"> 48</tt> <a class="py-toggle" href="#" id="S3Generator.set_expires-toggle" onclick="return toggle('S3Generator.set_expires');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="s3.generator.S3Generator-class.html#set_expires">set_expires</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">expires</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="S3Generator.set_expires-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="S3Generator.set_expires-expanded"><tt class="py-lineno"> 49</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<tt class="py-lineno"> 50</tt>  <tt class="py-line"><tt class="py-docstring">        Set absolute expiration time.</tt> </tt>
<tt class="py-lineno"> 51</tt>  <tt class="py-line"><tt class="py-docstring">        </tt> </tt>
<tt class="py-lineno"> 52</tt>  <tt class="py-line"><tt class="py-docstring">        @param expires: Absolute expiration time</tt> </tt>
<tt class="py-lineno"> 53</tt>  <tt class="py-line"><tt class="py-docstring">        @type  expires: time.time()</tt> </tt>
<tt class="py-lineno"> 54</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<tt class="py-lineno"> 55</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_expires</tt> <tt class="py-op">=</tt> <tt class="py-name">expires</tt> </tt>
<tt class="py-lineno"> 56</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_expires_in</tt> <tt class="py-op">=</tt> <tt class="py-name">None</tt> </tt>
</div><tt class="py-lineno"> 57</tt>  <tt class="py-line"> </tt>
<tt class="py-lineno"> 58</tt>  <tt class="py-line"> </tt>
<a name="S3Generator.make_bare_url"></a><div id="S3Generator.make_bare_url-def"><tt class="py-lineno"> 59</tt> <a class="py-toggle" href="#" id="S3Generator.make_bare_url-toggle" onclick="return toggle('S3Generator.make_bare_url');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="s3.generator.S3Generator-class.html#make_bare_url">make_bare_url</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">bucket</tt><tt class="py-op">,</tt> <tt class="py-param">key</tt><tt class="py-op">=</tt><tt class="py-string">''</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="S3Generator.make_bare_url-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="S3Generator.make_bare_url-expanded"><tt class="py-lineno"> 60</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<tt class="py-lineno"> 61</tt>  <tt class="py-line"><tt class="py-docstring">        Make an unauthorised URL.</tt> </tt>
<tt class="py-lineno"> 62</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<tt class="py-lineno"> 63</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">protocol</tt> <tt class="py-op">+</tt> <tt class="py-string">'://'</tt> <tt class="py-op">+</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">server_name</tt> <tt class="py-op">+</tt> <tt class="py-string">'/'</tt> <tt class="py-op">+</tt> <tt class="py-name">bucket</tt> <tt class="py-op">+</tt> <tt class="py-string">'/'</tt> <tt class="py-op">+</tt> <tt class="py-name">key</tt> </tt>
</div><tt class="py-lineno"> 64</tt>  <tt class="py-line"> </tt>
<tt class="py-lineno"> 65</tt>  <tt class="py-line"> </tt>
<a name="S3Generator._auth_header_value"></a><div id="S3Generator._auth_header_value-def"><tt class="py-lineno"> 66</tt> <a class="py-toggle" href="#" id="S3Generator._auth_header_value-toggle" onclick="return toggle('S3Generator._auth_header_value');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="s3.generator.S3Generator-class.html#_auth_header_value">_auth_header_value</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">method</tt><tt class="py-op">,</tt> <tt class="py-param">path</tt><tt class="py-op">,</tt> <tt class="py-param">headers</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="S3Generator._auth_header_value-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="S3Generator._auth_header_value-expanded"><tt class="py-lineno"> 67</tt>  <tt class="py-line">        <tt class="py-name">xamzs</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-name">k</tt> <tt class="py-keyword">for</tt> <tt class="py-name">k</tt> <tt class="py-keyword">in</tt> <tt class="py-name">headers</tt><tt class="py-op">.</tt><tt id="link-7" class="py-name" targets="Method s3.objects.S3Bucket.keys()=s3.objects.S3Bucket-class.html#keys,Method s3.service.S3Service.keys()=s3.service.S3Service-class.html#keys"><a title="s3.objects.S3Bucket.keys
s3.service.S3Service.keys" class="py-name" href="#" onclick="return doclink('link-7', 'keys', 'link-7');">keys</a></tt></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> <tt class="py-keyword">if</tt> <tt class="py-name">k</tt><tt class="py-op">.</tt><tt class="py-name">startswith</tt><tt class="py-op">(</tt><tt class="py-string">"x-amz-"</tt><tt class="py-op">)</tt><tt class="py-op">]</tt> </tt>
<tt class="py-lineno"> 68</tt>  <tt class="py-line">        <tt class="py-name">xamzs</tt><tt class="py-op">.</tt><tt class="py-name">sort</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<tt class="py-lineno"> 69</tt>  <tt class="py-line">        <tt class="py-name">auth_parts</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-name">method</tt><tt class="py-op">,</tt> </tt>
<tt class="py-lineno"> 70</tt>  <tt class="py-line">                      <tt class="py-name">headers</tt><tt class="py-op">.</tt><tt id="link-8" class="py-name" targets="Method s3.generator.S3Generator.get()=s3.generator.S3Generator-class.html#get,Method s3.objects.S3Bucket.get()=s3.objects.S3Bucket-class.html#get,Method s3.service.S3Service.get()=s3.service.S3Service-class.html#get"><a title="s3.generator.S3Generator.get
s3.objects.S3Bucket.get
s3.service.S3Service.get" class="py-name" href="#" onclick="return doclink('link-8', 'get', 'link-8');">get</a></tt></tt><tt class="py-op">(</tt><tt class="py-string">"Content-MD5"</tt><tt class="py-op">,</tt> <tt class="py-string">""</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<tt class="py-lineno"> 71</tt>  <tt class="py-line">                      <tt class="py-name">headers</tt><tt class="py-op">.</tt><tt id="link-9" class="py-name"><a title="s3.generator.S3Generator.get
s3.objects.S3Bucket.get
s3.service.S3Service.get" class="py-name" href="#" onclick="return doclink('link-9', 'get', 'link-8');">get</a></tt></tt><tt class="py-op">(</tt><tt class="py-string">"Content-Type"</tt><tt class="py-op">,</tt> <tt class="py-string">""</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<tt class="py-lineno"> 72</tt>  <tt class="py-line">                      <tt class="py-name">headers</tt><tt class="py-op">.</tt><tt id="link-10" class="py-name"><a title="s3.generator.S3Generator.get
s3.objects.S3Bucket.get
s3.service.S3Service.get" class="py-name" href="#" onclick="return doclink('link-10', 'get', 'link-8');">get</a></tt></tt><tt class="py-op">(</tt><tt class="py-string">"Date"</tt><tt class="py-op">,</tt> <tt class="py-string">""</tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt class="py-op">]</tt> </tt>
<tt class="py-lineno"> 73</tt>  <tt class="py-line">        <tt class="py-name">auth_parts</tt><tt class="py-op">.</tt><tt class="py-name">extend</tt><tt class="py-op">(</tt><tt class="py-op">[</tt><tt class="py-name">k</tt> <tt class="py-op">+</tt> <tt class="py-string">":"</tt> <tt class="py-op">+</tt> <tt class="py-name">headers</tt><tt class="py-op">[</tt><tt class="py-name">k</tt><tt class="py-op">]</tt><tt class="py-op">.</tt><tt class="py-name">strip</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> <tt class="py-keyword">for</tt> <tt class="py-name">k</tt> <tt class="py-keyword">in</tt> <tt class="py-name">xamzs</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<tt class="py-lineno"> 74</tt>  <tt class="py-line">         </tt>
<tt class="py-lineno"> 75</tt>  <tt class="py-line">        <tt class="py-comment"># Don't include anything after the first ?, unless there is an acl or torrent parameter</tt> </tt>
<tt class="py-lineno"> 76</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-name">stripped_path</tt> <tt class="py-op">=</tt> <tt class="py-name">path</tt><tt class="py-op">.</tt><tt class="py-name">split</tt><tt class="py-op">(</tt><tt class="py-string">'?'</tt><tt class="py-op">)</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> </tt>
<tt class="py-lineno"> 77</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">re</tt><tt class="py-op">.</tt><tt class="py-name">search</tt><tt class="py-op">(</tt><tt class="py-string">"[&amp;?]acl($|=|&amp;)"</tt><tt class="py-op">,</tt> <tt class="py-name">path</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<tt class="py-lineno"> 78</tt>  <tt class="py-line">            <tt class="py-name">stripped_path</tt> <tt class="py-op">+=</tt> <tt class="py-string">"?acl"</tt> </tt>
<tt class="py-lineno"> 79</tt>  <tt class="py-line">        <tt class="py-keyword">elif</tt> <tt class="py-name">re</tt><tt class="py-op">.</tt><tt class="py-name">search</tt><tt class="py-op">(</tt><tt class="py-string">"[&amp;?]torrent($|=|&amp;)"</tt><tt class="py-op">,</tt> <tt class="py-name">path</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<tt class="py-lineno"> 80</tt>  <tt class="py-line">            <tt class="py-name">stripped_path</tt> <tt class="py-op">+=</tt> <tt class="py-string">"?torrent"</tt> </tt>
<tt class="py-lineno"> 81</tt>  <tt class="py-line"> </tt>
<tt class="py-lineno"> 82</tt>  <tt class="py-line">        <tt class="py-name">auth_parts</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">stripped_path</tt><tt class="py-op">)</tt> </tt>
<tt class="py-lineno"> 83</tt>  <tt class="py-line">        <tt class="py-name">auth_str</tt> <tt class="py-op">=</tt> <tt class="py-string">"\n"</tt><tt class="py-op">.</tt><tt class="py-name">join</tt><tt class="py-op">(</tt><tt class="py-name">auth_parts</tt><tt class="py-op">)</tt> </tt>
<tt class="py-lineno"> 84</tt>  <tt class="py-line">        <tt class="py-name">auth_str</tt> <tt class="py-op">=</tt> <tt class="py-name">base64</tt><tt class="py-op">.</tt><tt class="py-name">encodestring</tt><tt class="py-op">(</tt> </tt>
<tt class="py-lineno"> 85</tt>  <tt class="py-line">            <tt class="py-name">hmac</tt><tt class="py-op">.</tt><tt class="py-name">new</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_priv_key</tt><tt class="py-op">,</tt> <tt class="py-name">auth_str</tt><tt class="py-op">,</tt> <tt class="py-name">sha</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt class="py-name">digest</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt class="py-name">strip</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<tt class="py-lineno"> 86</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">urllib</tt><tt class="py-op">.</tt><tt class="py-name">quote_plus</tt><tt class="py-op">(</tt><tt class="py-name">auth_str</tt><tt class="py-op">)</tt> </tt>
</div><tt class="py-lineno"> 87</tt>  <tt class="py-line"> </tt>
<tt class="py-lineno"> 88</tt>  <tt class="py-line"> </tt>
<a name="S3Generator._headers"></a><div id="S3Generator._headers-def"><tt class="py-lineno"> 89</tt> <a class="py-toggle" href="#" id="S3Generator._headers-toggle" onclick="return toggle('S3Generator._headers');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="s3.generator.S3Generator-class.html#_headers">_headers</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">headers</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-param">length</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-param">expires</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="S3Generator._headers-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="S3Generator._headers-expanded"><tt class="py-lineno"> 90</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">headers</tt><tt class="py-op">:</tt> </tt>
<tt class="py-lineno"> 91</tt>  <tt class="py-line">            <tt class="py-name">headers</tt> <tt class="py-op">=</tt> <tt class="py-op">{</tt><tt class="py-op">}</tt> </tt>
<tt class="py-lineno"> 92</tt>  <tt class="py-line">        <tt class="py-name">headers</tt><tt class="py-op">[</tt><tt class="py-string">"Date"</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-name">str</tt><tt class="py-op">(</tt><tt class="py-name">expires</tt><tt class="py-op">)</tt> </tt>
<tt class="py-lineno"> 93</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">length</tt> <tt class="py-keyword">is</tt> <tt class="py-keyword">not</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
<tt class="py-lineno"> 94</tt>  <tt class="py-line">            <tt class="py-name">headers</tt><tt class="py-op">[</tt><tt class="py-string">"Content-Length"</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-name">length</tt> </tt>
<tt class="py-lineno"> 95</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">headers</tt> </tt>
</div><tt class="py-lineno"> 96</tt>  <tt class="py-line"> </tt>
<tt class="py-lineno"> 97</tt>  <tt class="py-line"> </tt>
<a name="S3Generator._params"></a><div id="S3Generator._params-def"><tt class="py-lineno"> 98</tt> <a class="py-toggle" href="#" id="S3Generator._params-toggle" onclick="return toggle('S3Generator._params');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="s3.generator.S3Generator-class.html#_params">_params</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">params</tt><tt class="py-op">,</tt> <tt class="py-param">acl</tt><tt class="py-op">=</tt><tt class="py-name">False</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="S3Generator._params-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="S3Generator._params-expanded"><tt class="py-lineno"> 99</tt>  <tt class="py-line">        <tt class="py-name">p</tt> <tt class="py-op">=</tt> <tt class="py-string">''</tt> </tt>
<tt class="py-lineno">100</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">params</tt><tt class="py-op">:</tt> </tt>
<tt class="py-lineno">101</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">acl</tt><tt class="py-op">:</tt> </tt>
<tt class="py-lineno">102</tt>  <tt class="py-line">                <tt class="py-name">arg_div</tt> <tt class="py-op">=</tt> <tt class="py-string">'&amp;'</tt> </tt>
<tt class="py-lineno">103</tt>  <tt class="py-line">            <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<tt class="py-lineno">104</tt>  <tt class="py-line">                <tt class="py-name">arg_div</tt> <tt class="py-op">=</tt> <tt class="py-string">'?'</tt> </tt>
<tt class="py-lineno">105</tt>  <tt class="py-line">            <tt class="py-name">p</tt> <tt class="py-op">=</tt> <tt class="py-name">arg_div</tt> <tt class="py-op">+</tt> <tt class="py-name">urllib</tt><tt class="py-op">.</tt><tt class="py-name">urlencode</tt><tt class="py-op">(</tt><tt class="py-name">params</tt><tt class="py-op">)</tt> </tt>
<tt class="py-lineno">106</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">p</tt> </tt>
</div><tt class="py-lineno">107</tt>  <tt class="py-line"> </tt>
<tt class="py-lineno">108</tt>  <tt class="py-line"> </tt>
<a name="S3Generator._path"></a><div id="S3Generator._path-def"><tt class="py-lineno">109</tt> <a class="py-toggle" href="#" id="S3Generator._path-toggle" onclick="return toggle('S3Generator._path');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="s3.generator.S3Generator-class.html#_path">_path</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">bucket</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-param">key</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-param">acl</tt><tt class="py-op">=</tt><tt class="py-name">False</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="S3Generator._path-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="S3Generator._path-expanded"><tt class="py-lineno">110</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">bucket</tt> <tt class="py-keyword">is</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
<tt class="py-lineno">111</tt>  <tt class="py-line">            <tt class="py-name">path</tt> <tt class="py-op">=</tt> <tt class="py-string">"/"</tt> </tt>
<tt class="py-lineno">112</tt>  <tt class="py-line">        <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<tt class="py-lineno">113</tt>  <tt class="py-line">            <tt class="py-name">path</tt> <tt class="py-op">=</tt> <tt class="py-string">"/"</tt> <tt class="py-op">+</tt> <tt class="py-name">bucket</tt> </tt>
<tt class="py-lineno">114</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">key</tt> <tt class="py-keyword">is</tt> <tt class="py-keyword">not</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
<tt class="py-lineno">115</tt>  <tt class="py-line">                <tt class="py-name">path</tt> <tt class="py-op">+=</tt> <tt class="py-string">"/"</tt> <tt class="py-op">+</tt> <tt class="py-name">urllib</tt><tt class="py-op">.</tt><tt class="py-name">quote</tt><tt class="py-op">(</tt><tt class="py-name">key</tt><tt class="py-op">)</tt> </tt>
<tt class="py-lineno">116</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">acl</tt><tt class="py-op">:</tt> </tt>
<tt class="py-lineno">117</tt>  <tt class="py-line">            <tt class="py-name">path</tt> <tt class="py-op">+=</tt> <tt class="py-string">'?acl'</tt> </tt>
<tt class="py-lineno">118</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">path</tt> </tt>
</div><tt class="py-lineno">119</tt>  <tt class="py-line"> </tt>
<tt class="py-lineno">120</tt>  <tt class="py-line"> </tt>
<a name="S3Generator._io_len"></a><div id="S3Generator._io_len-def"><tt class="py-lineno">121</tt> <a class="py-toggle" href="#" id="S3Generator._io_len-toggle" onclick="return toggle('S3Generator._io_len');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="s3.generator.S3Generator-class.html#_io_len">_io_len</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">io</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="S3Generator._io_len-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="S3Generator._io_len-expanded"><tt class="py-lineno">122</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">hasattr</tt><tt class="py-op">(</tt><tt class="py-name">io</tt><tt class="py-op">,</tt> <tt class="py-string">"len"</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<tt class="py-lineno">123</tt>  <tt class="py-line">            <tt class="py-keyword">return</tt> <tt class="py-name">io</tt><tt class="py-op">.</tt><tt class="py-name">len</tt> </tt>
<tt class="py-lineno">124</tt>  <tt class="py-line">        <tt class="py-name">o_pos</tt> <tt class="py-op">=</tt> <tt class="py-name">io</tt><tt class="py-op">.</tt><tt class="py-name">tell</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<tt class="py-lineno">125</tt>  <tt class="py-line">        <tt class="py-name">io</tt><tt class="py-op">.</tt><tt class="py-name">seek</tt><tt class="py-op">(</tt><tt class="py-number">0</tt><tt class="py-op">,</tt> <tt class="py-number">2</tt><tt class="py-op">)</tt> </tt>
<tt class="py-lineno">126</tt>  <tt class="py-line">        <tt class="py-name">length</tt> <tt class="py-op">=</tt> <tt class="py-name">io</tt><tt class="py-op">.</tt><tt class="py-name">tell</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> <tt class="py-op">-</tt> <tt class="py-name">o_pos</tt> </tt>
<tt class="py-lineno">127</tt>  <tt class="py-line">        <tt class="py-name">io</tt><tt class="py-op">.</tt><tt class="py-name">seek</tt><tt class="py-op">(</tt><tt class="py-name">o_pos</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">)</tt> </tt>
<tt class="py-lineno">128</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">length</tt> </tt>
</div><tt class="py-lineno">129</tt>  <tt class="py-line"> </tt>
<tt class="py-lineno">130</tt>  <tt class="py-line"> </tt>
<a name="S3Generator._generate"></a><div id="S3Generator._generate-def"><tt class="py-lineno">131</tt> <a class="py-toggle" href="#" id="S3Generator._generate-toggle" onclick="return toggle('S3Generator._generate');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="s3.generator.S3Generator-class.html#_generate">_generate</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">method</tt><tt class="py-op">,</tt> <tt class="py-param">bucket</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-param">key</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> </tt>
<tt class="py-lineno">132</tt>  <tt class="py-line">                  <tt class="py-param">send_io</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-param">params</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-param">headers</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-param">acl</tt><tt class="py-op">=</tt><tt class="py-name">False</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="S3Generator._generate-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="S3Generator._generate-expanded"><tt class="py-lineno">133</tt>  <tt class="py-line">        <tt class="py-name">expires</tt> <tt class="py-op">=</tt> <tt class="py-number">0</tt> </tt>
<tt class="py-lineno">134</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_expires_in</tt> <tt class="py-op">!=</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
<tt class="py-lineno">135</tt>  <tt class="py-line">            <tt class="py-name">expires</tt> <tt class="py-op">=</tt> <tt class="py-name">int</tt><tt class="py-op">(</tt><tt class="py-name">time</tt><tt class="py-op">.</tt><tt class="py-name">time</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> <tt class="py-op">+</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_expires_in</tt><tt class="py-op">)</tt> </tt>
<tt class="py-lineno">136</tt>  <tt class="py-line">        <tt class="py-keyword">elif</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_expires</tt> <tt class="py-op">!=</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
<tt class="py-lineno">137</tt>  <tt class="py-line">            <tt class="py-name">expires</tt> <tt class="py-op">=</tt> <tt class="py-name">int</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_expires</tt><tt class="py-op">)</tt> </tt>
<tt class="py-lineno">138</tt>  <tt class="py-line"> </tt>
<tt class="py-lineno">139</tt>  <tt class="py-line">        <tt class="py-name">path</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-11" class="py-name" targets="Method s3.connection.S3Connection._path()=s3.connection.S3Connection-class.html#_path,Method s3.generator.S3Generator._path()=s3.generator.S3Generator-class.html#_path"><a title="s3.connection.S3Connection._path
s3.generator.S3Generator._path" class="py-name" href="#" onclick="return doclink('link-11', '_path', 'link-11');">_path</a></tt></tt><tt class="py-op">(</tt><tt class="py-name">bucket</tt><tt class="py-op">,</tt> <tt class="py-name">key</tt><tt class="py-op">,</tt> <tt class="py-name">acl</tt><tt class="py-op">)</tt> </tt>
<tt class="py-lineno">140</tt>  <tt class="py-line">        <tt class="py-name">length</tt> <tt class="py-op">=</tt> <tt class="py-name">None</tt> </tt>
<tt class="py-lineno">141</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">isinstance</tt><tt class="py-op">(</tt><tt class="py-name">headers</tt><tt class="py-op">,</tt> <tt class="py-name">dict</tt><tt class="py-op">)</tt> <tt class="py-keyword">and</tt> <tt class="py-name">headers</tt><tt class="py-op">.</tt><tt id="link-12" class="py-name" targets="Method s3.objects.S3Bucket.has_key()=s3.objects.S3Bucket-class.html#has_key,Method s3.service.S3Service.has_key()=s3.service.S3Service-class.html#has_key"><a title="s3.objects.S3Bucket.has_key
s3.service.S3Service.has_key" class="py-name" href="#" onclick="return doclink('link-12', 'has_key', 'link-12');">has_key</a></tt></tt><tt class="py-op">(</tt><tt class="py-string">"Content-Length"</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<tt class="py-lineno">142</tt>  <tt class="py-line">            <tt class="py-name">length</tt> <tt class="py-op">=</tt> <tt class="py-name">headers</tt><tt class="py-op">[</tt><tt class="py-string">"Content-Length"</tt><tt class="py-op">]</tt> </tt>
<tt class="py-lineno">143</tt>  <tt class="py-line">        <tt class="py-keyword">elif</tt> <tt class="py-name">send_io</tt> <tt class="py-keyword">is</tt> <tt class="py-keyword">not</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
<tt class="py-lineno">144</tt>  <tt class="py-line">            <tt class="py-name">length</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-13" class="py-name" targets="Method s3.connection.S3Connection._io_len()=s3.connection.S3Connection-class.html#_io_len,Method s3.generator.S3Generator._io_len()=s3.generator.S3Generator-class.html#_io_len"><a title="s3.connection.S3Connection._io_len
s3.generator.S3Generator._io_len" class="py-name" href="#" onclick="return doclink('link-13', '_io_len', 'link-13');">_io_len</a></tt></tt><tt class="py-op">(</tt><tt class="py-name">send_io</tt><tt class="py-op">)</tt> </tt>
<tt class="py-lineno">145</tt>  <tt class="py-line">        <tt class="py-name">headers</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-14" class="py-name" targets="Method s3.connection.S3Connection._headers()=s3.connection.S3Connection-class.html#_headers,Method s3.generator.S3Generator._headers()=s3.generator.S3Generator-class.html#_headers"><a title="s3.connection.S3Connection._headers
s3.generator.S3Generator._headers" class="py-name" href="#" onclick="return doclink('link-14', '_headers', 'link-14');">_headers</a></tt></tt><tt class="py-op">(</tt><tt class="py-name">headers</tt><tt class="py-op">=</tt><tt class="py-name">headers</tt><tt class="py-op">,</tt> <tt class="py-name">length</tt><tt class="py-op">=</tt><tt class="py-name">length</tt><tt class="py-op">,</tt> <tt class="py-name">expires</tt><tt class="py-op">=</tt><tt class="py-name">expires</tt><tt class="py-op">)</tt> </tt>
<tt class="py-lineno">146</tt>  <tt class="py-line">        <tt class="py-name">signature</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-15" class="py-name" targets="Method s3.connection.S3Connection._auth_header_value()=s3.connection.S3Connection-class.html#_auth_header_value,Method s3.generator.S3Generator._auth_header_value()=s3.generator.S3Generator-class.html#_auth_header_value"><a title="s3.connection.S3Connection._auth_header_value
s3.generator.S3Generator._auth_header_value" class="py-name" href="#" onclick="return doclink('link-15', '_auth_header_value', 'link-15');">_auth_header_value</a></tt></tt><tt class="py-op">(</tt><tt class="py-name">method</tt><tt class="py-op">,</tt> <tt class="py-name">path</tt><tt class="py-op">,</tt> <tt class="py-name">headers</tt><tt class="py-op">)</tt> </tt>
<tt class="py-lineno">147</tt>  <tt class="py-line">        <tt class="py-name">path</tt> <tt class="py-op">+=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-16" class="py-name" targets="Method s3.connection.S3Connection._params()=s3.connection.S3Connection-class.html#_params,Method s3.generator.S3Generator._params()=s3.generator.S3Generator-class.html#_params"><a title="s3.connection.S3Connection._params
s3.generator.S3Generator._params" class="py-name" href="#" onclick="return doclink('link-16', '_params', 'link-16');">_params</a></tt></tt><tt class="py-op">(</tt><tt class="py-name">params</tt><tt class="py-op">,</tt> <tt class="py-name">acl</tt><tt class="py-op">)</tt> </tt>
<tt class="py-lineno">148</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-string">'?'</tt> <tt class="py-keyword">in</tt> <tt class="py-name">path</tt><tt class="py-op">:</tt> </tt>
<tt class="py-lineno">149</tt>  <tt class="py-line">            <tt class="py-name">arg_div</tt> <tt class="py-op">=</tt> <tt class="py-string">'&amp;'</tt> </tt>
<tt class="py-lineno">150</tt>  <tt class="py-line">        <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<tt class="py-lineno">151</tt>  <tt class="py-line">            <tt class="py-name">arg_div</tt> <tt class="py-op">=</tt> <tt class="py-string">'?'</tt> </tt>
<tt class="py-lineno">152</tt>  <tt class="py-line">        <tt class="py-name">query_part</tt> <tt class="py-op">=</tt> <tt class="py-string">"Signature=%s&amp;Expires=%d&amp;AWSAccessKeyId=%s"</tt> <tt class="py-op">%</tt> <tt class="py-op">(</tt><tt class="py-name">signature</tt><tt class="py-op">,</tt> <tt class="py-name">expires</tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_pub_key</tt><tt class="py-op">)</tt> </tt>
<tt class="py-lineno">153</tt>  <tt class="py-line"> </tt>
<tt class="py-lineno">154</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">protocol</tt> <tt class="py-op">+</tt> <tt class="py-string">'://'</tt> <tt class="py-op">+</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">server_name</tt> <tt class="py-op">+</tt> <tt class="py-name">path</tt> <tt class="py-op">+</tt> <tt class="py-name">arg_div</tt> <tt class="py-op">+</tt> <tt class="py-name">query_part</tt> </tt>
</div><tt class="py-lineno">155</tt>  <tt class="py-line"> </tt>
<tt class="py-lineno">156</tt>  <tt class="py-line"> </tt>
<a name="S3Generator.create_bucket"></a><div id="S3Generator.create_bucket-def"><tt class="py-lineno">157</tt> <a class="py-toggle" href="#" id="S3Generator.create_bucket-toggle" onclick="return toggle('S3Generator.create_bucket');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="s3.generator.S3Generator-class.html#create_bucket">create_bucket</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">name</tt><tt class="py-op">,</tt> <tt class="py-param">headers</tt><tt class="py-op">=</tt><tt class="py-op">{</tt><tt class="py-op">}</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="S3Generator.create_bucket-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="S3Generator.create_bucket-expanded"><tt class="py-lineno">158</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<tt class="py-lineno">159</tt>  <tt class="py-line"><tt class="py-docstring">        Create a bucket.</tt> </tt>
<tt class="py-lineno">160</tt>  <tt class="py-line"><tt class="py-docstring">        </tt> </tt>
<tt class="py-lineno">161</tt>  <tt class="py-line"><tt class="py-docstring">        @param name:    Name for the new bucket</tt> </tt>
<tt class="py-lineno">162</tt>  <tt class="py-line"><tt class="py-docstring">        @type  name:    string</tt> </tt>
<tt class="py-lineno">163</tt>  <tt class="py-line"><tt class="py-docstring">        @param headers: Additional headers</tt> </tt>
<tt class="py-lineno">164</tt>  <tt class="py-line"><tt class="py-docstring">        @type  headers: dict</tt> </tt>
<tt class="py-lineno">165</tt>  <tt class="py-line"><tt class="py-docstring">        @return:        Authenticated URL for creating a bucket</tt> </tt>
<tt class="py-lineno">166</tt>  <tt class="py-line"><tt class="py-docstring">        @rtype:         string</tt> </tt>
<tt class="py-lineno">167</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<tt class="py-lineno">168</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-17" class="py-name" targets="Method s3.generator.S3Generator._generate()=s3.generator.S3Generator-class.html#_generate"><a title="s3.generator.S3Generator._generate" class="py-name" href="#" onclick="return doclink('link-17', '_generate', 'link-17');">_generate</a></tt></tt><tt class="py-op">(</tt><tt class="py-string">'PUT'</tt><tt class="py-op">,</tt> <tt class="py-name">bucket</tt><tt class="py-op">=</tt><tt class="py-name">name</tt><tt class="py-op">,</tt> <tt class="py-name">headers</tt><tt class="py-op">=</tt><tt class="py-name">headers</tt><tt class="py-op">)</tt> </tt>
</div><tt class="py-lineno">169</tt>  <tt class="py-line"> </tt>
<a name="S3Generator.list_bucket"></a><div id="S3Generator.list_bucket-def"><tt class="py-lineno">170</tt> <a class="py-toggle" href="#" id="S3Generator.list_bucket-toggle" onclick="return toggle('S3Generator.list_bucket');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="s3.generator.S3Generator-class.html#list_bucket">list_bucket</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">name</tt><tt class="py-op">,</tt> <tt class="py-param">params</tt><tt class="py-op">=</tt><tt class="py-op">{</tt><tt class="py-op">}</tt><tt class="py-op">,</tt> <tt class="py-param">headers</tt><tt class="py-op">=</tt><tt class="py-op">{</tt><tt class="py-op">}</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="S3Generator.list_bucket-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="S3Generator.list_bucket-expanded"><tt class="py-lineno">171</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<tt class="py-lineno">172</tt>  <tt class="py-line"><tt class="py-docstring">        List a bucket's content.</tt> </tt>
<tt class="py-lineno">173</tt>  <tt class="py-line"><tt class="py-docstring">        </tt> </tt>
<tt class="py-lineno">174</tt>  <tt class="py-line"><tt class="py-docstring">        @param name:    Bucket's name</tt> </tt>
<tt class="py-lineno">175</tt>  <tt class="py-line"><tt class="py-docstring">        @type  name:    string</tt> </tt>
<tt class="py-lineno">176</tt>  <tt class="py-line"><tt class="py-docstring">        @param params:  Additional parameters</tt> </tt>
<tt class="py-lineno">177</tt>  <tt class="py-line"><tt class="py-docstring">        @type  params:  dict</tt> </tt>
<tt class="py-lineno">178</tt>  <tt class="py-line"><tt class="py-docstring">        @param headers: Additional headers</tt> </tt>
<tt class="py-lineno">179</tt>  <tt class="py-line"><tt class="py-docstring">        @type  headers: dict</tt> </tt>
<tt class="py-lineno">180</tt>  <tt class="py-line"><tt class="py-docstring">        @return:        Authenticated URL for listing bucket's content</tt> </tt>
<tt class="py-lineno">181</tt>  <tt class="py-line"><tt class="py-docstring">        @rtype:         string</tt> </tt>
<tt class="py-lineno">182</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<tt class="py-lineno">183</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-18" class="py-name"><a title="s3.generator.S3Generator._generate" class="py-name" href="#" onclick="return doclink('link-18', '_generate', 'link-17');">_generate</a></tt></tt><tt class="py-op">(</tt><tt class="py-string">'GET'</tt><tt class="py-op">,</tt> <tt class="py-name">bucket</tt><tt class="py-op">=</tt><tt class="py-name">name</tt><tt class="py-op">,</tt> <tt class="py-name">params</tt><tt class="py-op">=</tt><tt class="py-name">params</tt><tt class="py-op">,</tt> <tt class="py-name">headers</tt><tt class="py-op">=</tt><tt class="py-name">headers</tt><tt class="py-op">)</tt> </tt>
</div><tt class="py-lineno">184</tt>  <tt class="py-line"> </tt>
<a name="S3Generator.delete_bucket"></a><div id="S3Generator.delete_bucket-def"><tt class="py-lineno">185</tt> <a class="py-toggle" href="#" id="S3Generator.delete_bucket-toggle" onclick="return toggle('S3Generator.delete_bucket');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="s3.generator.S3Generator-class.html#delete_bucket">delete_bucket</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">name</tt><tt class="py-op">,</tt> <tt class="py-param">headers</tt><tt class="py-op">=</tt><tt class="py-op">{</tt><tt class="py-op">}</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="S3Generator.delete_bucket-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="S3Generator.delete_bucket-expanded"><tt class="py-lineno">186</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<tt class="py-lineno">187</tt>  <tt class="py-line"><tt class="py-docstring">        Delete a bucket.</tt> </tt>
<tt class="py-lineno">188</tt>  <tt class="py-line"><tt class="py-docstring">        </tt> </tt>
<tt class="py-lineno">189</tt>  <tt class="py-line"><tt class="py-docstring">        @param name:    Name of the bucket that should be deleted</tt> </tt>
<tt class="py-lineno">190</tt>  <tt class="py-line"><tt class="py-docstring">        @type  name:    string</tt> </tt>
<tt class="py-lineno">191</tt>  <tt class="py-line"><tt class="py-docstring">        @param headers: Additional headers</tt> </tt>
<tt class="py-lineno">192</tt>  <tt class="py-line"><tt class="py-docstring">        @type  headers: dict</tt> </tt>
<tt class="py-lineno">193</tt>  <tt class="py-line"><tt class="py-docstring">        @return:        Authenticated URL for delete a bucket</tt> </tt>
<tt class="py-lineno">194</tt>  <tt class="py-line"><tt class="py-docstring">        @rtype:         string</tt> </tt>
<tt class="py-lineno">195</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<tt class="py-lineno">196</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-19" class="py-name"><a title="s3.generator.S3Generator._generate" class="py-name" href="#" onclick="return doclink('link-19', '_generate', 'link-17');">_generate</a></tt></tt><tt class="py-op">(</tt><tt class="py-string">'DELETE'</tt><tt class="py-op">,</tt> <tt class="py-name">bucket</tt><tt class="py-op">=</tt><tt class="py-name">name</tt><tt class="py-op">,</tt> <tt class="py-name">headers</tt><tt class="py-op">=</tt><tt class="py-name">headers</tt><tt class="py-op">)</tt> </tt>
</div><tt class="py-lineno">197</tt>  <tt class="py-line"> </tt>
<a name="S3Generator.list_buckets"></a><div id="S3Generator.list_buckets-def"><tt class="py-lineno">198</tt> <a class="py-toggle" href="#" id="S3Generator.list_buckets-toggle" onclick="return toggle('S3Generator.list_buckets');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="s3.generator.S3Generator-class.html#list_buckets">list_buckets</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">headers</tt><tt class="py-op">=</tt><tt class="py-op">{</tt><tt class="py-op">}</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="S3Generator.list_buckets-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="S3Generator.list_buckets-expanded"><tt class="py-lineno">199</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<tt class="py-lineno">200</tt>  <tt class="py-line"><tt class="py-docstring">        List all buckets</tt> </tt>
<tt class="py-lineno">201</tt>  <tt class="py-line"><tt class="py-docstring">        </tt> </tt>
<tt class="py-lineno">202</tt>  <tt class="py-line"><tt class="py-docstring">        @param headers: Additional headers</tt> </tt>
<tt class="py-lineno">203</tt>  <tt class="py-line"><tt class="py-docstring">        @type  headers: dict</tt> </tt>
<tt class="py-lineno">204</tt>  <tt class="py-line"><tt class="py-docstring">        @return:        Authenticated URL for listing all buckets</tt> </tt>
<tt class="py-lineno">205</tt>  <tt class="py-line"><tt class="py-docstring">        @rtype:         string</tt> </tt>
<tt class="py-lineno">206</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<tt class="py-lineno">207</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-20" class="py-name"><a title="s3.generator.S3Generator._generate" class="py-name" href="#" onclick="return doclink('link-20', '_generate', 'link-17');">_generate</a></tt></tt><tt class="py-op">(</tt><tt class="py-string">'GET'</tt><tt class="py-op">,</tt> <tt class="py-name">headers</tt><tt class="py-op">=</tt><tt class="py-name">headers</tt><tt class="py-op">)</tt> </tt>
</div><tt class="py-lineno">208</tt>  <tt class="py-line"> </tt>
<tt class="py-lineno">209</tt>  <tt class="py-line"> </tt>
<a name="S3Generator.put"></a><div id="S3Generator.put-def"><tt class="py-lineno">210</tt> <a class="py-toggle" href="#" id="S3Generator.put-toggle" onclick="return toggle('S3Generator.put');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="s3.generator.S3Generator-class.html#put">put</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">bucket</tt><tt class="py-op">,</tt> <tt class="py-param">key</tt><tt class="py-op">,</tt> <tt class="py-param">obj</tt><tt class="py-op">,</tt> <tt class="py-param">headers</tt><tt class="py-op">=</tt><tt class="py-op">{</tt><tt class="py-op">}</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="S3Generator.put-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="S3Generator.put-expanded"><tt class="py-lineno">211</tt>  <tt class="py-line">        <tt class="py-name">headers</tt><tt class="py-op">.</tt><tt class="py-name">update</tt><tt class="py-op">(</tt><tt class="py-name">obj</tt><tt class="py-op">.</tt><tt id="link-21" class="py-name" targets="Method s3.objects.S3Object.get_meta_for_headers()=s3.objects.S3Object-class.html#get_meta_for_headers"><a title="s3.objects.S3Object.get_meta_for_headers" class="py-name" href="#" onclick="return doclink('link-21', 'get_meta_for_headers', 'link-21');">get_meta_for_headers</a></tt></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<tt class="py-lineno">212</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-22" class="py-name"><a title="s3.generator.S3Generator._generate" class="py-name" href="#" onclick="return doclink('link-22', '_generate', 'link-17');">_generate</a></tt></tt><tt class="py-op">(</tt><tt class="py-string">'PUT'</tt><tt class="py-op">,</tt> <tt class="py-name">bucket</tt><tt class="py-op">=</tt><tt class="py-name">bucket</tt><tt class="py-op">,</tt> <tt class="py-name">key</tt><tt class="py-op">=</tt><tt class="py-name">key</tt><tt class="py-op">,</tt> <tt class="py-name">headers</tt><tt class="py-op">=</tt><tt class="py-name">headers</tt><tt class="py-op">)</tt> </tt>
</div><tt class="py-lineno">213</tt>  <tt class="py-line"> </tt>
<a name="S3Generator.get"></a><div id="S3Generator.get-def"><tt class="py-lineno">214</tt> <a class="py-toggle" href="#" id="S3Generator.get-toggle" onclick="return toggle('S3Generator.get');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="s3.generator.S3Generator-class.html#get">get</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">bucket</tt><tt class="py-op">,</tt> <tt class="py-param">key</tt><tt class="py-op">,</tt> <tt class="py-param">headers</tt><tt class="py-op">=</tt><tt class="py-op">{</tt><tt class="py-op">}</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="S3Generator.get-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="S3Generator.get-expanded"><tt class="py-lineno">215</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-23" class="py-name"><a title="s3.generator.S3Generator._generate" class="py-name" href="#" onclick="return doclink('link-23', '_generate', 'link-17');">_generate</a></tt></tt><tt class="py-op">(</tt><tt class="py-string">'GET'</tt><tt class="py-op">,</tt> <tt class="py-name">bucket</tt><tt class="py-op">=</tt><tt class="py-name">bucket</tt><tt class="py-op">,</tt> <tt class="py-name">key</tt><tt class="py-op">=</tt><tt class="py-name">key</tt><tt class="py-op">,</tt> <tt class="py-name">headers</tt><tt class="py-op">=</tt><tt class="py-name">headers</tt><tt class="py-op">)</tt> </tt>
</div><tt class="py-lineno">216</tt>  <tt class="py-line"> </tt>
<a name="S3Generator.delete"></a><div id="S3Generator.delete-def"><tt class="py-lineno">217</tt> <a class="py-toggle" href="#" id="S3Generator.delete-toggle" onclick="return toggle('S3Generator.delete');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="s3.generator.S3Generator-class.html#delete">delete</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">bucket</tt><tt class="py-op">,</tt> <tt class="py-param">key</tt><tt class="py-op">,</tt> <tt class="py-param">headers</tt><tt class="py-op">=</tt><tt class="py-op">{</tt><tt class="py-op">}</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="S3Generator.delete-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="S3Generator.delete-expanded"><tt class="py-lineno">218</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-24" class="py-name"><a title="s3.generator.S3Generator._generate" class="py-name" href="#" onclick="return doclink('link-24', '_generate', 'link-17');">_generate</a></tt></tt><tt class="py-op">(</tt><tt class="py-string">'DELETE'</tt><tt class="py-op">,</tt> <tt class="py-name">bucket</tt><tt class="py-op">=</tt><tt class="py-name">bucket</tt><tt class="py-op">,</tt> <tt class="py-name">key</tt><tt class="py-op">=</tt><tt class="py-name">key</tt><tt class="py-op">,</tt> <tt class="py-name">headers</tt><tt class="py-op">=</tt><tt class="py-name">headers</tt><tt class="py-op">)</tt> </tt>
</div><tt class="py-lineno">219</tt>  <tt class="py-line"> </tt>
<a name="S3Generator.get_bucket_acl"></a><div id="S3Generator.get_bucket_acl-def"><tt class="py-lineno">220</tt> <a class="py-toggle" href="#" id="S3Generator.get_bucket_acl-toggle" onclick="return toggle('S3Generator.get_bucket_acl');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="s3.generator.S3Generator-class.html#get_bucket_acl">get_bucket_acl</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">name</tt><tt class="py-op">,</tt> <tt class="py-param">headers</tt><tt class="py-op">=</tt><tt class="py-op">{</tt><tt class="py-op">}</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="S3Generator.get_bucket_acl-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="S3Generator.get_bucket_acl-expanded"><tt class="py-lineno">221</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<tt class="py-lineno">222</tt>  <tt class="py-line"><tt class="py-docstring">        Get acl information for a bucket.</tt> </tt>
<tt class="py-lineno">223</tt>  <tt class="py-line"><tt class="py-docstring">        </tt> </tt>
<tt class="py-lineno">224</tt>  <tt class="py-line"><tt class="py-docstring">        @param name:    Bucket name</tt> </tt>
<tt class="py-lineno">225</tt>  <tt class="py-line"><tt class="py-docstring">        @type  name:    string</tt> </tt>
<tt class="py-lineno">226</tt>  <tt class="py-line"><tt class="py-docstring">        @param headers: Additional headers</tt> </tt>
<tt class="py-lineno">227</tt>  <tt class="py-line"><tt class="py-docstring">        @type  headers: dict</tt> </tt>
<tt class="py-lineno">228</tt>  <tt class="py-line"><tt class="py-docstring">        @return:        Authenticated URL for getting acl information for a bucket</tt> </tt>
<tt class="py-lineno">229</tt>  <tt class="py-line"><tt class="py-docstring">        @rtype:         string</tt> </tt>
<tt class="py-lineno">230</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<tt class="py-lineno">231</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-25" class="py-name" targets="Method s3.generator.S3Generator.get_acl()=s3.generator.S3Generator-class.html#get_acl"><a title="s3.generator.S3Generator.get_acl" class="py-name" href="#" onclick="return doclink('link-25', 'get_acl', 'link-25');">get_acl</a></tt></tt><tt class="py-op">(</tt><tt class="py-name">name</tt><tt class="py-op">,</tt> <tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-name">headers</tt><tt class="py-op">)</tt> </tt>
</div><tt class="py-lineno">232</tt>  <tt class="py-line"> </tt>
<a name="S3Generator.get_acl"></a><div id="S3Generator.get_acl-def"><tt class="py-lineno">233</tt> <a class="py-toggle" href="#" id="S3Generator.get_acl-toggle" onclick="return toggle('S3Generator.get_acl');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="s3.generator.S3Generator-class.html#get_acl">get_acl</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">bucket</tt><tt class="py-op">,</tt> <tt class="py-param">key</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-param">headers</tt><tt class="py-op">=</tt><tt class="py-op">{</tt><tt class="py-op">}</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="S3Generator.get_acl-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="S3Generator.get_acl-expanded"><tt class="py-lineno">234</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<tt class="py-lineno">235</tt>  <tt class="py-line"><tt class="py-docstring">        Get acl information for an object.</tt> </tt>
<tt class="py-lineno">236</tt>  <tt class="py-line"><tt class="py-docstring">        </tt> </tt>
<tt class="py-lineno">237</tt>  <tt class="py-line"><tt class="py-docstring">        @param bucket:  Bucket's name</tt> </tt>
<tt class="py-lineno">238</tt>  <tt class="py-line"><tt class="py-docstring">        @type  bucket:  string</tt> </tt>
<tt class="py-lineno">239</tt>  <tt class="py-line"><tt class="py-docstring">        @param key:     Object's name</tt> </tt>
<tt class="py-lineno">240</tt>  <tt class="py-line"><tt class="py-docstring">        @type  key:     string</tt> </tt>
<tt class="py-lineno">241</tt>  <tt class="py-line"><tt class="py-docstring">        @param headers: Additional headers</tt> </tt>
<tt class="py-lineno">242</tt>  <tt class="py-line"><tt class="py-docstring">        @type  headers: dict</tt> </tt>
<tt class="py-lineno">243</tt>  <tt class="py-line"><tt class="py-docstring">        @return:        Authenticated URL for getting acl information for an object</tt> </tt>
<tt class="py-lineno">244</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<tt class="py-lineno">245</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-26" class="py-name"><a title="s3.generator.S3Generator._generate" class="py-name" href="#" onclick="return doclink('link-26', '_generate', 'link-17');">_generate</a></tt></tt><tt class="py-op">(</tt><tt class="py-string">'GET'</tt><tt class="py-op">,</tt> <tt class="py-name">acl</tt><tt class="py-op">=</tt><tt class="py-name">True</tt><tt class="py-op">,</tt> <tt class="py-name">bucket</tt><tt class="py-op">=</tt><tt class="py-name">bucket</tt><tt class="py-op">,</tt> <tt class="py-name">key</tt><tt class="py-op">=</tt><tt class="py-name">key</tt><tt class="py-op">,</tt> <tt class="py-name">headers</tt><tt class="py-op">=</tt><tt class="py-name">headers</tt><tt class="py-op">)</tt> </tt>
</div><tt class="py-lineno">246</tt>  <tt class="py-line"> </tt>
<a name="S3Generator.put_bucket_acl"></a><div id="S3Generator.put_bucket_acl-def"><tt class="py-lineno">247</tt> <a class="py-toggle" href="#" id="S3Generator.put_bucket_acl-toggle" onclick="return toggle('S3Generator.put_bucket_acl');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="s3.generator.S3Generator-class.html#put_bucket_acl">put_bucket_acl</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">name</tt><tt class="py-op">,</tt> <tt class="py-param">acl_xml_document</tt><tt class="py-op">,</tt> <tt class="py-param">headers</tt><tt class="py-op">=</tt><tt class="py-op">{</tt><tt class="py-op">}</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="S3Generator.put_bucket_acl-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="S3Generator.put_bucket_acl-expanded"><tt class="py-lineno">248</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-27" class="py-name" targets="Method s3.generator.S3Generator.put_acl()=s3.generator.S3Generator-class.html#put_acl"><a title="s3.generator.S3Generator.put_acl" class="py-name" href="#" onclick="return doclink('link-27', 'put_acl', 'link-27');">put_acl</a></tt></tt><tt class="py-op">(</tt><tt class="py-name">name</tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">,</tt> <tt class="py-name">acl_xml_document</tt><tt class="py-op">,</tt> <tt class="py-name">headers</tt><tt class="py-op">)</tt> </tt>
</div><tt class="py-lineno">249</tt>  <tt class="py-line"> </tt>
<tt class="py-lineno">250</tt>  <tt class="py-line">    <tt class="py-comment"># don't really care what the doc is here.</tt> </tt>
<a name="S3Generator.put_acl"></a><div id="S3Generator.put_acl-def"><tt class="py-lineno">251</tt> <a class="py-toggle" href="#" id="S3Generator.put_acl-toggle" onclick="return toggle('S3Generator.put_acl');">-</a><tt class="py-line"><tt class="py-comment"></tt>    <tt class="py-keyword">def</tt> <a class="py-def-name" href="s3.generator.S3Generator-class.html#put_acl">put_acl</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">bucket</tt><tt class="py-op">,</tt> <tt class="py-param">key</tt><tt class="py-op">,</tt> <tt class="py-param">acl_xml_document</tt><tt class="py-op">,</tt> <tt class="py-param">headers</tt><tt class="py-op">=</tt><tt class="py-op">{</tt><tt class="py-op">}</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="S3Generator.put_acl-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="S3Generator.put_acl-expanded"><tt class="py-lineno">252</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-28" class="py-name"><a title="s3.generator.S3Generator._generate" class="py-name" href="#" onclick="return doclink('link-28', '_generate', 'link-17');">_generate</a></tt></tt><tt class="py-op">(</tt><tt class="py-string">'PUT'</tt><tt class="py-op">,</tt> <tt class="py-name">acl</tt><tt class="py-op">=</tt><tt class="py-name">True</tt><tt class="py-op">,</tt> <tt class="py-name">bucket</tt><tt class="py-op">=</tt><tt class="py-name">bucket</tt><tt class="py-op">,</tt> <tt class="py-name">key</tt><tt class="py-op">=</tt><tt class="py-name">key</tt><tt class="py-op">,</tt> <tt class="py-name">headers</tt><tt class="py-op">=</tt><tt class="py-name">headers</tt><tt class="py-op">)</tt> </tt>
</div></div><tt class="py-lineno">253</tt>  <tt class="py-line"> </tt><script type="text/javascript">
<!--
expandto(location.href);
// -->
</script>
</pre>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="s3-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

      <th class="navbar" width="100%"></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">Generated by Epydoc
        3.0alpha3 on Wed Sep 20 12:10:44 2006</td>
    <td align="right" class="footer">
      <a href="http://epydoc.sourceforge.net">http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie()
  // -->
</script>
  
</body>
</html>
